package model.dao.impl;

import java.awt.List;
import java.util.HashMap;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import model.bean.Persona;
import model.dao.PersonaDao;



public class PersonaDaoImpl extends SqlMapClientDaoSupport implements PersonaDao{

	@Override
	public Persona consultarPersona(String dni) {
		Map map = new HashMap();
		map.put("dni", dni);
		Persona per = (Persona)getSqlMapClientTemplate().queryForList("persona.getPersona", map).get(0);
		
		System.out.println( "Valor de persona encontrada" );
		System.out.println( "dni:" + per.getDni() );
		System.out.println( "nombres:" + per.getNombres() );
		return per;
	}

	@Override
	public void crearPersona(Persona per) {
		getSqlMapClientTemplate().queryForObject("persona.insertPersona", per);
	}

	@Override
	public List listarPersonas() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void modificarPersona(Persona per) {
		// TODO Auto-generated method stub
		
	}

}
